﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using static socketio.socketio.Data;

namespace SocketioTest.Common
{
    public class ChatDataTemplateSelector : DataTemplateSelector
    {
        public DataTemplate HeMsgContent { get; set; }

        public DataTemplate MyMsgContent { get; set; }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            var stu = (ChatRecord)item;
            if (stu.sender_userId != Global.uid)
                return HeMsgContent;
            else
                return MyMsgContent;
        }
    }
}
